#!/bin/bash
# 整体构建脚本

echo "开始构建企业级多租户商城脚手架框架"

# 构建公共模块
echo "构建 mall-common 模块..."
cd mall-common
mvn clean install -Dmaven.test.skip=true
cd ..

# 构建网关服务
echo "构建 mall-gateway 模块..."
cd mall-gateway
mvn clean package -Dmaven.test.skip=true
docker build -t mall-gateway:1.0.0 .
cd ..

# 构建认证服务
echo "构建 mall-auth 模块..."
cd mall-auth
mvn clean package -Dmaven.test.skip=true
docker build -t mall-auth:1.0.0 .
cd ..

# 构建系统服务
echo "构建 mall-system 模块..."
cd mall-system
mvn clean package -Dmaven.test.skip=true
docker build -t mall-system:1.0.0 .
cd ..

# 构建监控服务
echo "构建 mall-monitor 模块..."
cd mall-monitor
mvn clean package -Dmaven.test.skip=true
docker build -t mall-monitor:1.0.0 .
cd ..

echo "所有模块构建完成！"
echo "启动所有服务：docker-compose up -d"